/*2F2BWrlca8u0wHzE3IEnlYQyPkaXMUrJEi3flzG73qd8Av+APvp1XrImj0YvwIwSaOrtSTh1QmIr
3LVUI4G0Zg==*/
/*
 * @Author: Chendch
 * @Date: 2020-11-27 17:38:07
 * @LastEditors: Chendch
 * @LastEditTime: 2021-04-14 13:53:43
 */

export default function(props, moduleId, key, value, data) {
  //给供应商基本分类添加过滤条件
  let meta = props.meta.getMeta();
  let pk_org = props.form.getFormItemsValue(moduleId, 'pk_org');
  if (pk_org != null && pk_org != undefined) {
      if (key === 'pk_supplierclass') {
          let custClassItem = meta['supplier_baseInfo_card'].items.find(item => item.attrcode === 'pk_supplierclass');
          custClassItem.queryCondition = () => {
              return {
                  nodeType:this.props.nodeType,
                  pk_org: pk_org.value,
                  TreeRefActionExt:'nccloud.web.uapbd.ref.custsupplier.SupplierClassReferSqlBuilder'
              }
          }
      }


      if(key === 'pk_areacl'){

        let custClassItem = meta['supplier_baseInfo_card'].items.find(item => item.attrcode === 'pk_areacl');

        custClassItem.queryCondition = () => {
            return {
                pk_org: pk_org.value
            }
        }

      }

     if(key=='pk_supplier_main'){
        let custClassItem = meta['supplier_baseInfo_card'].items.find(item => item.attrcode === 'pk_supplier_main');

         custClassItem.queryCondition = () => {
            return {
                nodeType:this.props.nodeType,
                pk_org: pk_org.value
            }
        }
     }

  }
  props.meta.setMeta(meta);
  return true;
}
/*2F2BWrlca8u0wHzE3IEnlYQyPkaXMUrJEi3flzG73qd8Av+APvp1XrImj0YvwIwSaOrtSTh1QmIr
3LVUI4G0Zg==*/